import { constantRoutes } from '@/router/index'
const state = {
  menuList: [...constantRoutes] // 用来保存当前用户所有可以访问的页面对应的路由信息
}

const mutations = {
  setmenu(state, asyncMenu) {
    // 把动态路由(每个用户登录后的功能都不一样) ,存进来
    // state.menuList.push(...asyncMenu)
    state.menuList = [...constantRoutes, ...asyncMenu]
  }
}

export default {
  namespaced: true,
  state,
  mutations
}
